package com.ist.smartmonitor.util;

import java.io.FileWriter;
import java.io.IOException;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

import com.ist.data.Data;
import com.ist.data.ObjectFactory;
import com.ist.data.Station;


public class Bla {
	
	private static ObjectFactory factory = new ObjectFactory();
	
	public static Data populate() {
		Data data = factory.createData();
		Station station1 = factory.createStation();
		station1.setId(1);
		data.getStations().add(station1);
		Station station2 = factory.createStation();
		station2.setId(2);
		data.getStations().add(station2);
		return data;
	}

//	public static void main(String[] args) {
//		JAXBContext context;
//		try {
//			context = JAXBContext.newInstance(Data.class);
//			Marshaller marshaller = context.createMarshaller();
//			marshaller.marshal(populate(), new FileWriter("resources/data.xml"));
//		} catch (JAXBException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//
//	}
	
}
